rm(list=ls())

library(tidyverse)
library(ggpubr)
library(stargazer)
library(estimatr)


#Save data
df <- read.csv("gallup_suffolk_clean.csv")

#Descriptive plot
plot <- ggplot(df, aes(x = Pres_Approval_Gallup_weighted, y = Repub_weighted, 
                        shape = factor(Party_First))) +
  geom_point() + 
  geom_smooth(method = lm, color="black") + 
  scale_shape_manual(name = "Question Order", breaks = c(0,1), 
                     labels = c("Approval first", "Partisanship first"), values = c(19,17)) +
  xlab("Gallup Presidential Approval (%)") +
  ylab("% in Republican Party") +
  theme_bw()

  ggsave("Output/external_validity_plot_trump.pdf", plot = last_plot())